<template>
<view class="pen_item" v-for="(item, index) in penData" :key="index">
    <view>
        <image class="default_pen" src="../images/default_pen.png" />
    </view>
    <view class="penItem_center">
        <text class="pen_text">{{item.nickName }}</text>
    </view> 
    <button @click="emit('connect', item)" class="connect_btn">连接</button>
</view>
</template>

<script setup>

defineProps(['penData'])
const emit = defineEmits(['connect'])

</script>

<style scoped>
  .pen_content{
    /* width: 90%;
    height: 1000px;
    margin: 40px auto 0 auto;
    overflow: scroll; */
    /* background-color: red; */
  }
  .pen_item {
    padding: 40px 32px;
    border-radius: 20px;
    background-color: #FFF;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
  }
  .default_pen{
    width: 136px;
    height: 136px;
  }
  .connect_btn {
    width: 128px;
    height: 80px;
    line-height: 80px;
    font-size: 30px;
    color: #FFF;
    text-align: center;
    background-color: #956F31;
    border-radius: 50px;
    display: inline-block;
  }


  .penItem_center{
    width: 57%;
    height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-left: 20px;
    box-sizing: border-box;
  }

  .pen_text {
    width: 100%;
    font-family: 'siyuan';
    font-size: 40px;
    font-weight: bold;
    text-align: left;
    align-self:self-start;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: block;
    
  }

  .isConnect {
    align-self: flex-start;
    color: #816747;
  }
</style>